{% macro gen_form(form, tag_form, current_user) %}
    {% import "_my_wtf_macros.html" as my_wtf_macros %}

    <form id="search-user-form" action="{{ url_for('op_bp.user_list') }}"
          method="post" class="form" role="form">
        {{ my_wtf_macros.form_field(form.id, div_col=4, label_col=4, field_col=7) }}
        {{ my_wtf_macros.form_field(form.type, div_col=4, label_col=4, field_col=7) }}
        {{ my_wtf_macros.form_field(form.level, div_col=4, label_col=4, field_col=7) }}
        {{ my_wtf_macros.form_field(form.mobile, div_col=4, label_col=4, field_col=7) }}
        {{ my_wtf_macros.form_field(form.nickname, div_col=4, label_col=4, field_col=7) }}
        {{ my_wtf_macros.form_field(form.com, div_col=4, label_col=4, field_col=7) }}
        {{ my_wtf_macros.form_field(form.prov, div_col=4, label_col=4, field_col=7) }}
        {{ my_wtf_macros.form_field(form.city, div_col=4, label_col=4, field_col=7) }}
        {{ my_wtf_macros.form_field(form.active, div_col=4, label_col=4, field_col=7) }}
        {{ my_wtf_macros.form_field(form.status, div_col=4, label_col=4, field_col=7) }}
        {{ my_wtf_macros.form_field(form.binded_wx, div_col=4, label_col=4, field_col=7) }}
        {{ my_wtf_macros.form_field(form.black, div_col=4, label_col=4, field_col=7) }}
        <div class="clearfix visible-xs-block visible-sm-block visible-md-block visible-lg-block"></div>

        <div class="pull-left btn-group">
            <button class="btn btn-default"
                    id="tag-spread-btn">标签
                <span style="margin-left: 15px" id="display-icon"
                      class="glyphicon glyphicon-menu-down pull-right"
                      aria-hidden="true">
                </span>
            </button>
        </div>
        <div class="clearfix visible-xs-block visible-sm-block visible-md-block visible-lg-block"></div>
        <br>

        <div id="tags-wrapper" class="hidden">
            {{ my_wtf_macros.form_field(tag_form.follow_state, div_col=4, label_col=4, field_col=7) }}
            {{ my_wtf_macros.form_field(tag_form.aspiration, div_col=4, label_col=4, field_col=7) }}
            {{ my_wtf_macros.form_field(tag_form.gold_aspiration, div_col=4, label_col=4, field_col=7) }}
            {{ my_wtf_macros.form_field(tag_form.supplier_aspiration, div_col=4, label_col=4, field_col=7) }}
            {{ my_wtf_macros.form_field(tag_form.pay_aspiration, div_col=4, label_col=4, field_col=7) }}
            {{ my_wtf_macros.form_field(tag_form.paid_feel, div_col=4, label_col=4, field_col=7) }}
            {{ my_wtf_macros.form_field(tag_form.mastery, div_col=4, label_col=4, field_col=7) }}
            {{ my_wtf_macros.form_field(tag_form.scale, div_col=4, label_col=4, field_col=7) }}
            {{ my_wtf_macros.form_field(tag_form.contact_frequency, div_col=4, label_col=4, field_col=7) }}
            {{ my_wtf_macros.form_field(tag_form.injured, div_col=4, label_col=4, field_col=7) }}
            {{ my_wtf_macros.form_field(tag_form.impression, div_col=4, label_col=4, field_col=7) }}
            {{ my_wtf_macros.form_field(tag_form.business, div_col=4, label_col=4, field_col=7) }}
        </div>
        <div class="clearfix visible-xs-block visible-sm-block visible-md-block visible-lg-block"></div>
        <div class="pull-right btn-group">
            <button type="submit" class="btn btn-info"
                    id="query-user-btn">
                查询
            </button>
            {% if not current_user.is_agent %}
                <a
                    href="javascript:void(0);"
                    target="_blank"
                    class="btn-group btn btn-primary"
                    id="export-users"
                >
                    导出
                </a>
            {% endif %}
        </div>
    </form>
{% endmacro %}
